<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>06函数</title>
</head>
<body>
<script>
    function f1() {
        console.log('你好，星期五')
    }

    f1();
    f1();
    f1();
    f1();

    function f2(n) {
        console.log('形参值为：' + n);
    }

    f2(666);
    f2('下午好');

    function f3(a, b) {
        console.log(a);
        console.log(b);
        console.log(a + b);
    }

    f3(1, 2);
    f3(1);/*Not a Number*/
    f3(3, 4, 5);/*取前两位*/
    function f4() {
        console.log(arguments);
    }

    f4(1, 2, 3);
    f4(908, 67)

    function f5(x, y) {
        return x + y;
    }

    console.log(f5(2, 3));
    let res = f5(10, 10);
    console.log(res);

    let f6 = function (){
        console.log('第二种');
    }
    f6();
    console.log(typeof f6);
    console.log(f6);

    let f7 = new Function("name","age","console.log('方法体');return age;");
    console.log(f7('小明',18));

</script>
</body>
</html>